<?php
App::uses('AppModel', 'Model');
/**
 * Event Model
 *
 * @property Character $Character
 */
class Event extends AppModel {
/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'name' => array(
			'notEmpty' => array(
				'rule' => array('notempty'),
				'message' => 'All events must have a name',
			),
		),
		'checkout' => array(
			'boolean' => array(
				'rule' => array('boolean'),
				'message' => 'Checkout can only be completed or not-completed (i.e. true or false)',
			),
		),
		'deleted' => array(
			'boolean' => array(
				'rule' => array('boolean'),
				'message' => 'You should not be seeing this message. Deleted should be true or false.',
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * hasAndBelongsToMany associations
 *
 * @var array
 */
	public $hasAndBelongsToMany = array(
		'Character' => array(
			'className' => 'Character',
			'joinTable' => 'characters_events',
			'foreignKey' => 'event_id',
			'associationForeignKey' => 'character_id',
			'unique' => 'keepExisting',
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

}
